package com.excel;

import java.io.File;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import com.bean.BaseModel;
import com.bean.imp.DictItemImp;

/**
 * excel路径
 * @author zhoufang
 * @version v0.1 2019年7月9日 下午3:21:59  zhoufang
 */
public class ExcelPath {
	
	private static final String EXCEL_BASE_PATH = File.separator + "excel\\";
	
	public static Map<Class<? extends BaseModel>, String> excelPath = new ConcurrentHashMap<Class<? extends BaseModel>, String>();
	
	static{
		excelPath.put(DictItemImp.class, "item.xlsx");
		
		
	}
	
	public static String getExcelBasePath(){
		String property = System.getProperty("user.dir");
		return property + EXCEL_BASE_PATH;
	}
	
	public static String getExcelPath(Class<? extends BaseModel> clazz){
		String excelName = excelPath.get(clazz);
		if(excelName == null){
			return null;
		}
		return getExcelBasePath() + excelName;
	}
}
